package com.xhwy.service.impl;

import com.xhwy.entity.ProductImage;
import com.xhwy.mapper.ProductImageMapper;
import com.xhwy.param.ProductIdParam;
import com.xhwy.service.ProductImageService;
import com.xhwy.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductImageServiceImpl implements ProductImageService {

    @Autowired
    private ProductImageMapper productImageMapper;

    /**
     * 根据商品id获取商品图片信息
     *
     * @param productIdParam 已经校验过的商品id参数
     * @return
     */
    @Override
    public R getByProductId(ProductIdParam productIdParam) {
        List<ProductImage> list = productImageMapper.getByProductId(productIdParam.getProductId());
        return R.ok("查询成功", list);
    }
}
